/* Create By WangJun(wangjunneil@gmail.com) On 2013/01/03 */

/* 根据len截断字符串content */
function cutoutStr(content, len) {
    var newContent = "";
    if (content.length > len) newContent = content.substring(0, len) + '......(' + content.length + '字)';
    else newContent = content;
    return newContent;
}

/* 用指定字符chr分割字符串content */
function splitStr(content, chr) {
    if (content == null || content == 'undifined') return "";

    var newContent = "";
    var oldTags = content.split(chr);
    for (i = 0; i < oldTags.length; i++) {
        newContent += oldTags[i];
        newContent += ' ';
    }
    return newContent;
}

/* 使用层显示指定的错误信息 */
function showErrorMsg(messageDiv, errorMsg) {
    messageDiv.style.display = 'block';
    messageDiv.innerHTML = "<span>错误：</span>" + errorMsg;
}